package com.restaurant.application.accumulategoods;

import com.nebutown.description.UnitDescription;
import com.nebutown.generation.BeanSpec;
import com.nebutown.generation.basictype.UID;
import com.restaurant.application.accumulategoods.support.GoodsData;
import com.restaurant.application.util.ImageData;

public class AccumulateGoodsDesc extends UnitDescription {
    public static void main(String[] args) {
        UnitDescription desc = UnitDescription.basicUnit(AccumulateGoods.class, "GoodsData");

        desc.nextBean("GoodsData")
                .add("createTime", Long.class)

                .add("modifyTime", Long.class)
                // 商品编码（优惠券编码）
                .add("goodsId", String.class)

                .add("goodsName", String.class)

                .add("images", BeanSpec.listOf(ImageData.class.getName()))

                .add("goodsCategory", String.class)
                .add("typeId", String.class)
                .add("typeIdUid", String.class)

                .add("accessLevel", String.class)
                .add("levelUid", UID.class)
                .add("accumulatePoints", Long.class)

                .add("goodsDescribe", String.class)
                // 兑换数量限制
                .add("numberLimit", Long.class)

                // 上下架
                .add("state", String.class)

                .add("price", Double.class)

                .add("forSellTime", Long.class)

                .add("removeTime", Long.class)

                // 剩余数量
                .add("soldNumber", Long.class)

                // 总数量
                .add("totalNUmber", Long.class)

                .add("useShop", String.class)
                .add("useShopId", String.class)
                .add("useShopUid", UID.class)

                .add("immediately", Boolean.class);
        desc
                .addUiFunction("save", GoodsData.class.getName())
                .addUiFunction("cancel",null);

        desc.addUiFactory("consumption", "ConsumptionData", SUBS.NONE);

        desc.run("./");
    }
}
